package com.leetcode.math;

import java.util.ArrayList;
import java.util.List;

public class GetRowYH {
    public static void main(String[] args) {

    }

    public List<Integer> getRow(int rowIndex) {
        List<Integer> resList = new ArrayList<>();
        resList.add(1);
        for (int i = 1; i <= rowIndex; i++) {
            resList.add(0);
            for (int j = i; j > 0; j--) {
                resList.set(j, resList.get(j) + resList.get(j - 1));
            }
        }
        return resList;
    }
}
